import service from '@/utils/crmRequest'

export default () => ({
  // 新建回款
  RETURNEDMONEY_CREATE: (data) => {
    return service({
      url: '/api/finance/rcreate',
      method: 'post',
      data
    })
  },
  // 回款编辑
  RETURNEDMONEY_EDIT: (data) => {
    return service({
      url: '/api/finance/rupdate',
      method: 'post',
      data
    })
  },
  // 回款删除
  RETURNEDMONEY_DELETE: (params) => {
    return service({
      url: '/api/finance/rdelete',
      method: 'delete',
      params
    })
  },
  // 回款列表
  RETURNEDMONEY_LIST: (data) => {
    return service({
      url: '/api/finance/rlist',
      method: 'post',
      data
    })
  },
  // 收款管理--详情
  RETURNEDMONEY_DETAIL: (params) => {
    return service({
      url: '/api/finance/rdetail',
      method: 'get',
      params
    })
  },
  // ------------------------ 发货销售应收 -------------------------------
  // 应收统计列表
  RECEIVABLE_LIST: (data) => {
    return service({
      url: '/api/finance/receivable/list',
      method: 'post',
      data
    })
  },
  // 应收详情金额统计
  RECEIVABLE_DETAIL_PRICE: (data) => {
    return service({
      url: '/api/finance/receivable/detail/total',
      method: 'post',
      data
    })
  },
  // 应收详情列表
  RECEIVABLE_DETAIL_LIST: (data) => {
    return service({
      url: '/api/finance/receivable/detail/list',
      method: 'post',
      data
    })
  },
  // ------------------------ 间接应收 -------------------------------
  // 间接应收--应收统计列表
  RECEIVABLE_INDIRECT_LIST: (data) => {
    return service({
      url: '/api/finance/receivable/indirect/list',
      method: 'post',
      data
    })
  },
  // 间接应收--应收详情金额统计
  RECEIVABLE_INDIRECT_DETAIL_PRICE: (data) => {
    return service({
      url: '/api/finance/receivable/indirect/detail/total',
      method: 'post',
      data
    })
  },
  // 间接应收--应收详情列表
  RECEIVABLE_INDIRECT_DETAIL_LIST: (data) => {
    return service({
      url: '/api/finance/receivable/indirect/detail/list',
      method: 'post',
      data
    })
  },
  // 不同类型客户（应收）---下拉列表
  CUSTOMER_LIST_BY_TYPE: (params) => {
    return service({
      url: '/api/finance/customer',
      method: 'get',
      params
    })
  },
  // 不同类型客户（应收）---下拉列表
  RECEIVABLE_CUSTOMER_LIST_BY_TYPE: (params) => {
    return service({
      url: '/api/finance/receive/customer',
      method: 'get',
      params
    })
  },
  // 回款客户下拉筛选
  RETURNEDMONEY_CUSTOMER_LIST: (params) => {
    return service({
      url: '/api/finance/split-customer',
      method: 'get',
      params
    })
  },
})
